﻿
<%namespace YouHP.Model%>
<%namespace YouHP.Utility%>
<%namespace YouHP.Model.Group%>

<%template _Header%>
<script type="text/javascript">

function loadCommentList(id)
{
  _$("reply_box_"+id).innerHTML="<div style=\"text-align:center;\"><font color=\"red\">请稍后...</font></div>";
  var aurl = "/Pages/alpha/Ajax/CommentConversationAjax.aspx?parentId="+id;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
       var html=this.response.text; 
       _$("reply_box_"+id).innerHTML = html;
      }
   }
   );
   myAjax.request();
  
  
}  
function replyadd(id)
{
   _$("reply_box_"+id).innerHTML="<div style=\"text-align:center;padding:10px;\"><font color=\"red\">请稍后...</font></div>";
  var aurl = "/Pages/alpha/Ajax/CommentConversationAjax.aspx?parentId="+id;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
       _$("reply_box_"+id).innerHTML =  this.response.text;
       _$("replycontent_"+id).focus();
      }
   }
   );
   myAjax.request();
}

function CommentReplyAdd(id)
{
    var replycontent = _$("replycontent_"+id).value;
      
        if (replycontent.length == 0)
        {
            alert("回复内容不能为空！");
            return;
        }
        if(replycontent.length > 300 ) 
        {
            alert("回复内容不能超过300个字！");
            return;
        }
      
      _$("replybutton").disabled = true;
      var aurl = "/Pages/alpha/Ajax/CommentConversationReplyAddAjax.aspx?commentId="+id+"&replycontent="+replycontent.escUrl();
      var myAjax=new Ajax(aurl,
      {
         method:'get',
         onComplete:function()
         {
           _$("reply_box_"+id).innerHTML= this.response.text;
           _$("replycontent_"+id).value = "";
           _$("replybutton").disabled = false;
          }
       }
       );
       myAjax.request();
}

function replyComment(id)
{
    var e1 = document.getElementById('replybox_'+id); 
    var e2 = document.getElementById('replycontent_'+id); 
    e1.style.display = 'block';
    e2.focus();

 }
function replycancell(id)
{
    var e1 = document.getElementById('replybox_'+id); 
    var e2 = document.getElementById('replycontent_'+id); 
    e1.style.display = 'none';
    e2.value = "";
}

</script>
<style>
.bar
{    
overflow:hidden;
background:#D8DFEA none repeat scroll 0 0;
border-bottom:1px solid #CCCCCC;
border-top:1px solid #3B5998;

}
.replyitem
{
border-bottom:1px dotted #949494;
clear:left;
margin:0pt 0pt;
overflow:hidden;
padding:5px;

width:100%;

}
.replyitem a:link,.replyitem a:visited
{
	color:Green!important;
	text-decoration:underline;
}
	

.replyitem li
{
	list-style-image:none;
list-style-position:outside;
list-style-type:none;
padding:5px 5px 10px 5px;
}
.replyitem p
{
	clear:none !important;
margin:0pt !important;
}
.replyitem img.avatar
{
	float:left;
width:45px;
height:45px;
margin-right:10px;
}
</style>


<div class="layout2-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
		<div class="pannelbody">
		

	    <div class="pl"id="commentList">
        
         <div style="padding:20px 50px;">
              <div style="border-bottom:1px dotted #949494;">共<b><font name="fedcount" id="fedcount">{DataCount}</font></b>条</div>
         <!-- <ul class="hugbook" id="hugbook">-->
          <%csharp%>
            foreach (CommentInfo item in CommentReplyDataList)
            {
          <%/csharp%> 
            <div id="reply_box_{item.ParentId}" class="replyitem">
                
               <div style="padding-left:20px; text-align:center; float:left;">
                
               <%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.PostUserId;<%/csharp%>
               <a href="{this.GetUrl(TempUrl)}"><img class="avatar" width="45" height="45" src="{item.PostAvatar}"/></a>
               </div>
               <div style="margin:0pt 10px 0pt 82px;">
               
           <p class="graytext">
               
                <span style="float:right;">
                     <a href="javascript:" onclick="replyadd({item.ParentId});"><font color=#949494>回复</font></a>&nbsp;&nbsp;&nbsp;&nbsp;
                </span>
                
                <%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.PostUserId; <%/csharp%>  
                <a class="client_name" href="{this.GetUrl(TempUrl)}">{item.PostUserName}</a>
                <%csharp%>TempUrl = item.PostTime.ToString("yyyy-MM-dd  HH:mm");<%/csharp%>  
                &nbsp;{TempUrl}
                
             </p>   
                  <p class="longtextfix">{item.Body}</p>
                  <p style="float:right;"><span style="color:#949494"></span>&nbsp;&nbsp;<a href="javascript:" onclick="loadCommentList({item.ParentId});"><font color=Green>+展开会话</font></a></p>

               </div>
            </div>
          <%csharp%>
               }
         <%/csharp%>   

<!--          </ul>-->

            <div style="margin:10px 5px;">
            <div class="pages">
	            {PagingString}
            </div>

            </div>  
          
          </div>

	    </div>     


</div>
</div>
</div>
	    
      
</div> 
</div>


<%template _footer%>		
